package com.flyqiu.flow.core;

import com.flyqiu.flow.api.script.IVariableScope;
import com.flyqiu.flow.model.business.BaseFlyBusiness;
import com.flyqiu.flow.api.context.FlyQiuFlowGlobalContext;
import com.flyqiu.flow.api.context.ProcInstContext;


import com.flyqiu.flow.bpmn.FlyQiuBpmModeler;
import com.flyqiu.flow.bpmn.element.ProcessModel;
import com.flyqiu.flow.model.entity.ProcDeployDef;
import com.flyqiu.flow.model.entity.ru.ProcRuInst;
import lombok.Data;
import lombok.Getter;

@Data
public class DefaultProcInstContext implements ProcInstContext {

    private IVariableScope procVariables;

    private ProcDeployDef procDeployDef;

    private ProcRuInst procInst;
    @Getter
    private FlyQiuFlowGlobalContext globalContext;

    private ProcessModel curProcessModel;

    private FlyQiuBpmModeler flyQiuBpmModeler;

    private BaseFlyBusiness baseFlyBusiness;



    public static DefaultProcInstContext create(ProcInstContext procContext) {
        DefaultProcInstContext defaultProcInstContext = new DefaultProcInstContext();
        defaultProcInstContext.setGlobalContext(defaultProcInstContext.getGlobalContext());
        defaultProcInstContext.setProcVariables(procContext.getProcVariables());
        defaultProcInstContext.setCurProcessModel(procContext.getCurProcessModel());
        defaultProcInstContext.setFlyQiuBpmModeler(procContext.getBpmModeler());
        defaultProcInstContext.setProcDeployDef(procContext.getProcDeployDef());
        defaultProcInstContext.setBaseFlyBusiness(procContext.getProcBusiness());
        return defaultProcInstContext;
    }

    public BaseFlyBusiness getProcBusiness() {
        return baseFlyBusiness;
    }

    @Override
    public FlyQiuBpmModeler getBpmModeler() {
        return flyQiuBpmModeler;
    }


}
